import { reactive } from "vue";
export function useFilter() {
  const ft = reactive({
    query: {},
    page: {
      size: 10,
      current: 1,
      total: 0,
    },
  });
  const resetSearch = (callback) => {
    Object.keys(ft.query).forEach((key) => {
      ft.query[key] = "";
    });
    ft.page.current = 1;
    ft.page.total = 0;
    if (callback && typeof callback === "function") {
      callback();
    }
  };
  return { ft, resetSearch };
}
